package effective_java.design_pattern.decorator;

/**
 * 鸡蛋
 *
 * @author Verlet
 * @date 2023-09-06 01:27
 */
public class Egg extends Garnish {
    public Egg(FastFood fastFood) {
        super(1, "鸡蛋", fastFood);
    }

    @Override
    public float cost() {
        return getPrice() + getFastFood().cost();
    }

    @Override
    public String getDesc() {
        return super.getDesc() + "加" + getFastFood().getDesc();
    }
}
